import static org.junit.Assert.*;

import org.junit.Test;


public class testManhattanDistance {

	private int calculateHeuristicPathLengthBetween( Cord c1, Cord c2 )
	{
		return (Math.abs( c1.getX()-c2.getX() ) + Math.abs( c1.getY()-c2.getY() ));
	}
	
	@Test
	public void test() 
	{
		
		assertTrue( calculateHeuristicPathLengthBetween(
				new CordImpl(0,0), 
				new CordImpl(0,0)) 
				== 0 );
		
		
		assertTrue( calculateHeuristicPathLengthBetween(
				new CordImpl(4,0), 
				new CordImpl(0,4)) 
				== 8 );
		
		assertTrue( calculateHeuristicPathLengthBetween(
				new CordImpl(4,2), 
				new CordImpl(2,4)) 
				== 4 );
		
		assertTrue( calculateHeuristicPathLengthBetween(
				new CordImpl(0,2), 
				new CordImpl(2,4)) 
				== 4 );
		
		assertTrue( calculateHeuristicPathLengthBetween(
				new CordImpl(0,2), 
				new CordImpl(2,0)) 
				== 4 );
	}

}
